<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@page import="java.util.HashMap"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html> 
	<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
			<title>登录后台管理系统</title>
		    <link href="<%=path%>/admin/css/style.css" rel="stylesheet" type="text/css">
		    <script type="text/javascript" src="<%=path%>/JS/jquery-1.7.2.js"></script>
			<!-- <script type="text/javascript" src="/JS/extjs/adapter/ext-base.js"></script>
			<script type="text/javascript" src="/JS/extjs/ext-all.js"></script>
			<script type="text/javascript" src="/javascript/md5.js"></script> -->
		 	<style>
				.x-form-element{padding-left:0px;po	sition:relative;}
			</style>
	</head>
    <script type="text/javascript">
		var password = "";
        //验证输入
		function validate_required(){
            if(document.form.username.value.length == 0){
               alert('输入用户名!');
               document.form.username.focus();
               return false;
            }else if(document.form.password.value.length == 0){
               alert('输入密码!');
               document.form.password.focus();
               return false;
            }
			/*var inputpassword =document.form.password.value;
			var inputpasswordmd5 = hex_md5(inputpassword);
			if (inputpasswordmd5 != password)
			{
				if (password.length<32)
				{
					if (password != inputpassword)//如果密码没有加密
					{
						alert('输入密码有误！');
						document.form.password.focus();
						return false;
					}
				}else{
					alert('输入密码有误！');
					document.form.password.focus();
					return false;
				}
			}*/
			
            return true;
        }
		//ajax 匹配用户名和用户编码
		function checkUser(){
			//alert(1111);
			/*if (document.form.usertemp.value.length>0)
			{
				document.form.usercode.value = document.form.usertemp.value;
				Ext.Ajax.request({
				  url: 'login.do?action=checkUser',
				  method:'POST',
				  params: {usercode:document.form.usercode.value},
				  success: function(response, opts){
					var resultjson = Ext.util.JSON.decode(response.responseText);
					var succ = resultjson.success;
					if(succ){
						var username = resultjson.username;
						document.form.usertemp.value = username;
						password = resultjson.password;
					}else {
							var reason = resultjson.reason;
							alert(reason);
							document.form.usertemp.focus();
					}
				  },
				  failure: function(response, opts){
					 alert('连接服务器失败！');
				    //Ext.MessageBox.alert('信息提示','更新失败!');				  
				  }
				});
			}*/				
		}
		/*function editUser(){
			if (document.form.usercode.value.length>0)
			{
				document.form.usertemp.value = document.form.usercode.value ;
			}
		}*/

		$(function(){
			$("#username").blur(function(){
			});
			
		});
    </script>

<body> 

<table width="100%" cellpadding="0" cellspacing="0" class = "top">
  
  <tr> 
  <td id="logo" width="100%" height="30" align="left">
      
  </td>
  </tr>
  
</table>
<table width="90%" align="right" style="margin-top:120px;margin-bottom:90px;">
  <tr> 
    <td width="40%" height="260" style="border-right:1px solid #DADADA"> 
      <table width="90%" align="top">
        <tr>
          <td align="right"><img src="<%=path%>/admin/images/index.jpg " width="366" height="200"></td>
        </tr>
      </table>
    </td>
    <td width="60%" valign="top" style="padding-left:30px;padding-top:15px;" id="form_td"> 
      <form method="post" name="form" action="${pageContext.request.contextPath}/adminLoginAction.action" onsubmit="return validate_required()">
	      <table width="80%">
	        <tr> 
	          <td colspan="2" class="Ltitle" style="border-bottom:1px solid #DADADA;">系统登录</td>
	        </tr>
	        <tr> 
	          <td>&nbsp;</td>
	          <td>&nbsp;</td>
	        </tr>
	        <tr> 
	          <td width="13%" height="30">用户名</td>
	          <td width="87%" class="x-form-element"><input type="text" name="adminUser.username" id="username"  class="login_INPUT1" onMouseOver="this.className='login_INPUT2'" onMouseOut="this.className='login_INPUT1'" onblur ="checkUser()" ><!-- onfocus ="editUser()" >-->
			  <!-- <input type="hidden" name="usercode" id="usercode" > 
			  <font color="red"><s:fielderror name="usernameerror"></s:fielderror></font>-->
	          </td>
	        </tr>
	        <tr> 
	          <td height="30">密 &nbsp;码</td>
	          <td class="x-form-element">
	          	<input type="password" id="password" name="adminUser.password" class="login_INPUT1" onMouseOver="this.className='login_INPUT2'" onMouseOut="this.className='login_INPUT1'" >
	          	<font color="red"><s:fielderror name="passworderror"></s:fielderror></font>
	          	<!--<input type = "hidden" id="appsystem" name="appsystem" value = "${param.appcode}">  -->
	          </td>
	        </tr>
	        <tr> 
	          <td>&nbsp;</td>
	          <td height="30">
				<input type="submit" name="Submit" value="登 录" class="button4" onMouseOver="this.className='button4_over'" onMouseOut="this.className='button4'"></td>
	        </tr>
	        <tr> 
	        </tr>
	      </table>
	  </form>
    </td>
  </tr>
</table> 
<table width="100%" class="bottom" style="bottom:0;position :absolute">
  <tr> 
    <td align="center">
    </td>
  </tr>
</table>
</body> 

</html>